Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Improved collaboration cursor UX #1374

Merged
merged 4 commits into from
Jan 17, 2025
Merged

feat: Improved collaboration cursor UX #1374

merged 4 commits into from
Jan 17, 2025

Conversation

matthewlipski
Copy link
Collaborator

@matthewlipski matthewlipski commented Jan 15, 2025

This PR improves the collaboration cursor UX so that the name tag no longer annoyingly blocks user text selection. The UX changes are summarized here: #1163 (comment).

User 1 and 2 collaborate in real-time, from user 1's perspective:

  • When user 2 writes, their name is displayed
  • After X seconds of user 2's inactivity, their name disappears
  • When user 1 hovers over user 2's cursor, user 2's name is displayed for X seconds
  • The cursor remains visible at all times. To improve its visibility, we can either add a dot as suggested by Virgile, or increase its thickness.

ezgif-5-bce5e744ef

Closes #1163

Copy link

vercel bot commented Jan 15, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
blocknote ✅ Ready (Inspect) Visit Preview Jan 17, 2025 10:22am
blocknote-website ✅ Ready (Inspect) Visit Preview Jan 17, 2025 10:22am

- Cleaned up code
- Added visibility dot to cursors
- Added animations
label.classList.add("collaboration-cursor__label");
label.setAttribute("style", `background-color: ${user.color}`);
label.insertBefore(document.createTextNode(user.name), null);
cursorElement.addEventListener("mouseenter", () => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this needed or can we just use css :hover?

Copy link
Collaborator Author

@matthewlipski matthewlipski Jan 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we still want it - GDocs behaviour still has a delay for hiding after moving the mouse off the cursor. We could have a CSS transition delay instead but it's added complexity in both cases so this is ok imo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The nametag over other editors cursor hides the text behind it
3 participants